/**
 *<p>Copyright: Copyright (c) 2012</p> 
 *<p>Company: SCPII</p>
 *<p>Project:scpii-api</p>
 *@author xiezhouyan
 *@Date 2013-5-2 上午11:13:08
 *@version 1.0
 *@description:
 */
package com.scpii.api.domain.user;

import java.io.Serializable;
import java.text.MessageFormat;

import org.codehaus.jackson.map.annotate.JsonSerialize;

import com.scpii.api.common.Constants;
import com.scpii.api.common.json.serializer.ResourceUrlSerializer;

public class UserActionsContent extends UserActions implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3355517020555406575L;

	private Integer type;

	private Integer favCount;

	private Integer joinCount;

	private Integer commentCount;

	private Integer viewCount;

	private Long contentId;

	private String contentName;

	private String contentUrl;

	@JsonSerialize(using = ResourceUrlSerializer.class, include = JsonSerialize.Inclusion.NON_NULL)
	private String contentImgUrl;

	private String contentDescription;

	public Long getContentId() {
		return contentId;
	}

	public void setContentId(Long contentId) {
		this.contentId = contentId;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getContentName() {
		return contentName;
	}

	public void setContentName(String contentName) {
		this.contentName = contentName;
	}

	public String getContentUrl() {
		if (type == null) {
			return contentImgUrl;
		}
		if (type < 3) {
			contentUrl = Constants.UNIVERSAL_WEB_ROOT_URL
					+ MessageFormat.format(
							Constants.UNIVERSAL_CONTENT_URL_TEMPLATE,
							String.valueOf(contentId));
		}
		return contentUrl;
	}

	public void setContentUrl(String contentUrl) {
		this.contentUrl = contentUrl;
	}

	public String getContentImgUrl() {
		return contentImgUrl;
	}

	public void setContentImgUrl(String contentImgUrl) {
		this.contentImgUrl = contentImgUrl;
	}

	public String getContentDescription() {
		return contentDescription;
	}

	public void setContentDescription(String contentDescription) {
		this.contentDescription = contentDescription;
	}

	public Integer getFavCount() {
		return favCount;
	}

	public void setFavCount(Integer favCount) {
		this.favCount = favCount;
	}

	public Integer getJoinCount() {
		return joinCount;
	}

	public void setJoinCount(Integer joinCount) {
		this.joinCount = joinCount;
	}

	public Integer getCommentCount() {
		return commentCount;
	}

	public void setCommentCount(Integer commentCount) {
		this.commentCount = commentCount;
	}

	public Integer getViewCount() {
		return viewCount;
	}

	public void setViewCount(Integer viewCount) {
		this.viewCount = viewCount;
	}

}
